<template>
  <!-- 交接验收 -->
  <view class="container">
  	<view class="background-white" v-for="item in info.pursueInfoDtoList" :key="`${item.id}-'pu'`">
  		<view class="flex text bor-btm">
  			检修人：<text>{{item.executeUserName}}</text>
  		</view>
  		<view class="flex text bor-btm">
  			确认时间：<text>{{item.createTime}}</text>
  		</view>
  	</view>

	<view class="hidden-title">完工照片</view>
	<view class="background-white">
	  <view class="work-image">
	    <image-upload
			v-for="(s, si) in srcList" :key="`${si}-'src'`"
	      state="view"
	      :imageUrl="s.imagePath"
	    ></image-upload>
	  </view>
	</view>

  	<view class="background-white bor-top">
  		<uni-table ref="table" border stripe emptyText="暂无更多数据">
  			<uni-tr>
  				<uni-th width="50" align="center">序号</uni-th>
  				<uni-th width="120" align="center">备件名称</uni-th>
  				<uni-th width="60" align="center">数量</uni-th>
  				<uni-th width="60" align="center">实际使用数量</uni-th>
  			</uni-tr>
  			<uni-tr v-for="(item, index) in partList" :key="index">
  				<uni-td>{{ index+1 }}</uni-td>
  				<uni-td>{{ item.partName }}</uni-td>
  				<uni-td>{{ item.partNum }}</uni-td>
  				<uni-td>{{ item.partUseNum }}</uni-td>
  			</uni-tr>
  		</uni-table>
  	</view>
  	<view class="background-white bor-top">
  		<uni-table ref="table" border stripe emptyText="暂无更多数据">
  			<uni-tr>
  				<uni-th width="50" align="center">序号</uni-th>
  				<uni-th width="120" align="center">验收事项</uni-th>
  				<uni-th width="80" align="center">是否合格</uni-th>
  			</uni-tr>
  			<uni-tr v-for="(item, index) in itemList" :key="index">
  				<uni-td>{{ index+1 }}</uni-td>
  				<uni-td>{{ item.acceptMatter }}</uni-td>
  				<uni-td>{{ ['', '合格', '不合格'][item.acceptType] }}</uni-td>
  			</uni-tr>
  		</uni-table>
  	</view>

	<view class="background-white bor-top" v-for="item in acceptInfoList" :key="item.id">
		<view class="flex text bor-btm">
			<view class="pb-10">检修后技术状况：</view>
			<text>{{item.examineCondition}}</text>
		</view>
		<view class="flex text bor-btm">
			<view class="pb-10">遗留问题：</view>
			<text>{{item.remain}}</text>
		</view>
	</view>
  </view>
</template>

<script>
	import config from '@/config.js'
	import ImageUpload from "@/components/image-upload/index.vue";

	export default{
		components: {
		  ImageUpload,
		},
		props: {
			info: {
				type: Object
			}
		},
		data(){
			return{
				staticUrl: '',
				partList: [],
				itemList: [],
				srcList: [],
				acceptInfoList: []
			}
		},
		watch: {
			info(n, o) {
			}
		},
		mounted() {
			this.staticUrl = config.staticUrl
			console.log('info', this.info)
			console.log('staticUrl', this.staticUrl)

			this.partList = this.info.checkInfoDto ? this.info.checkInfoDto.partList : []
			this.itemList = this.info.acceptResp ? this.info.acceptResp.itemList : [],
			this.srcList = this.info.checkInfoDto ? this.info.checkInfoDto.imageList : [],
			this.acceptInfoList = this.info.acceptResp ? this.info.acceptResp.acceptInfoList : []
		},
		methods:{

		}
	}
</script>

<style lang="scss" scoped>
	.container {
		.background-white {
			background-color: #fff;
			padding: 20rpx 30rpx;
			box-sizing: border-box;

			.uni-forms-item__label {
				color: #333;
				font-size: 30rpx;
			}

			.bor-btm {
				display: flex;
				border-bottom: 1px solid #d5d7e3;
			}
			.text {
				padding-bottom: 20rpx;
				padding-top: 4rpx;
				color: #333;

				text {
					color: #666;
				}

				.blue {
					color: #88B4C4;
				}
			}
		}
	}

	.hidden-title {
		background: #f5f5f5;
		padding: 20rpx;
		color: #999;
	}

	.bor-top {
		border-top: 20rpx solid #f5f5f5;
	}

	.submit-group {
		background: #fff;
		z-index: 9;
		padding: 30px;
	}

	.u-button {
		width: 600rpx;
	}
	.flex.text.bor-btm{
		align-items: baseline;
	}
	.work-image ::v-deep  .uni-list{
		display: inline;
		.uni-list-cell{
			display: inline-flex;
		}
	}
</style>
